/**
* \file ITCPServerSocket.h
* \brief ITCPServerSocket decleration class
* \author Edouard ROGE
* \date 04 Novembre 2013
*/
#ifndef _ITCPSERVERSOCKET_
#define _ITCPSERVERSOCKET_

#include "ITCPSocket.h"

namespace Core
{
	namespace Network
	{
		class ITCPServerSocket
		{
		public:

			/**
			* \fn virtual void Bind(uint32 _iPort);
			* \param _iPort port to bind the socket
			* \brief Bind socket
			*/
			virtual void Bind(uint32 _iPort) = 0;

			/**
			* \fn virtual ITCPSocket * AcceptConnection() = 0;
			* \return a TCP socket to this connection
			* \brief Accept a connection
			*/
			virtual ITCPSocket * AcceptConnection() = 0;

			/**
			* \fn virtual void Send(void * _pBuffer, uint32 _iSize) = 0;
			* \brief Send data through the socket
			*/
			virtual void Send(void * _pBuffer, uint32 _iSize) = 0;

			/**
			* \fn virtual void Receive(void * _pBuffer, uint32 _iSize) = 0;
			* \brief Receive data through the socket
			*/
			virtual void Receive(void * _pBuffer, uint32 _iSize) = 0;

			/**
			* \fn void Close();
			* \brief Close socket
			*/
			virtual void Close() = 0;

			/**
			* \fn void Connect();
			* \brief Connect to another socket
			*/
			virtual void Connect(const std::string & _strAddress, uint32 _iPort) = 0;
		};
	}
}

#endif // _ITCPSERVERSOCKET_
